package org.spring.core.split.xml;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public class SimpleBean {
	private int currentValue;
	@Value(value="#{CONST1}")
	int MAX_VALUE;
	public int getCurrentValue() {
		return currentValue;
	}
	
	@PostConstruct
	public void init(){
		System.out.println("in init... @PostConstruct");
		this.currentValue=800;
		check();
	}

	public void setCurrentValue(int currentValue) {
		System.out.println("Setting current Value...");
		this.currentValue = currentValue;
		check();
	}
	
	public void check(){
		if(currentValue<MAX_VALUE){
			System.out.println(this.currentValue + " is < " + MAX_VALUE);
		}else{
			System.out.println(this.currentValue + " is > " + MAX_VALUE);
		}
	}
	private DatabaseDriver databaseDriver;
	public DatabaseDriver getDatabaseDriver() {
		return databaseDriver;
	}
	public void setDatabaseDriver(DatabaseDriver databaseDriver) {
		this.databaseDriver = databaseDriver;
	}
}
